const app = {
    state: {
        condition: {
            gradeId:0,
            gradeName:'',
            classId:0,
            className:'',
            lessonId:0,
            lessonItemId:0,
            lessonName:'',
            teacherId:0,
            teacherName:'',
            doing:'必排课'
        }
    },
    mutations: {
        EDIT_CONDITION: (state, value) => {
           const comp= state.condition
            for (let key in value) {
                if (comp[key] === undefined) {
                    continue
                }
                if (typeof value[key] === 'object') {
                    Object.assign(comp[key], value[key])
                } else {
                    comp[key] = value[key]
                }
            }
        }       
    },
    getters : {
        state: state => state,
        condition: state => state.condition,

    }
}

export default app